Skip to content

Preserve namespace metadata on XPath attribute results - #137

Merged
zhengchun merged 1 commit into
antchfx:masterfrom
rupayon123:contribution/xpath-attribute-namespace-20260923
Oct 10, 2026
Merged

zhengchun merged 1 commit into
antchfx:masterfrom
rupayon123:contribution/xpath-attribute-namespace-20260923

Conversation

@rupayon123

Copy link
Copy Markdown
Contributor

Fixes #108.

XPath queries for namespaced attributes currently return a synthetic AttributeNode with its value and local name, but empty Prefix and NamespaceURI. Copy those fields from the NodeNavigator when creating the result. A regression test covers //@xlink:href and an ordinary unprefixed attribute.

The new test failed on the current master branch and passes with this change. go test ./... -count=1, go test -race ./... -count=1, go vet ./..., and git diff --check pass locally. Remote CI remains to be checked. Prepared with AI assistance and reviewed and tested before submission.

@zhengchun
zhengchun merged commit a6a7ad2 into antchfx:master Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing AttributeNode prefix and namespace URI

2 participants